#!/usr/bin/python
# -*- coding:utf-8 -*-
#bogo排序
#@author: wklken@yeah.net

import random
def is_order(l):
    for i in range(len(l)-1):
        if l[i] > l[i+1]:
          return False
    return True

def bogo_sort(l):
    while not is_order(l):
        random.shuffle(l)
        print l

l = [1,5,2]
bogo_sort(l)